package com.dingyh.shopwebbackground.service.impl;

import com.dingyh.shopwebbackground.entity.Address;
import com.dingyh.shopwebbackground.mapper.AddressMapper;
import com.dingyh.shopwebbackground.service.AddressService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author dingyuhan
 * @since 2023-02-16
 */
@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements AddressService {

    @Autowired
    AddressMapper addressMapper;

    public List<Address> getAddressList(Map<String,Object> map){
        return addressMapper.getAddressList(map);
    }

    public boolean removeAddress(String id) {
        try {
            return removeById(id);
        }catch (Exception e){
            System.out.println(e);
            return false;
        }
    }
}
